package com.tarena.lbs.basic.web.rpc;

import com.tarena.lbs.basic.api.UserGroupApi;
import com.tarena.lbs.basic.web.service.UserGroupService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@DubboService
@Component
@Slf4j
public class UserGroupApiImpl implements UserGroupApi {
    @Autowired
    private UserGroupService userGroupService;
    @Override
    public boolean isUserGroup(Integer userId, Integer userGroupId) {
        try{
            //让业务对象判断所属结果
            return userGroupService.isUserGroup(userId,userGroupId);
        }catch (Exception e){
            log.error("验证所属人群失败",e);
        }
        return false;
    }
}
